using System.IO;

namespace Engine.FileFormats3D.C11Syndikat.QADFile
{
    public class TextureName
    {
        #region Private Fields

        private char[] chars = new char[32];

        #endregion Private Fields

        #region Internal Constructors

        internal TextureName(char[] name)
        {
            for (int i = 0; i < name.Length; i++)
            {
                this.chars[i] = name[i];
                if (name[i] == '\0')
                    break;
            }
        }

        #endregion Internal Constructors

        #region Public Properties

        public char[] Chars
        {
            get { return chars; }
            set { chars = value; }
        }

        #endregion Public Properties

        #region Public Methods

        public override string ToString()
        {
            return new string(this.chars).Trim(new char[] { '\0' });
        }

        #endregion Public Methods

        #region Internal Methods

        internal static TextureName FromStream(BinaryReader br)
        {
            return new TextureName(br.ReadChars(32));
        }

        #endregion Internal Methods
    }
}